package com.google.code.opengw.policy;

public class PolicyFactory {

	private static PolicyFactory factory;
	
	static {
		factory = new PolicyFactory();
	}
	
	private PolicyFactory(){
	}
	
	public static PolicyFactory getInstance(){
		return factory;
	}
	
	public Policy createPolicy(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{
		Class clazz = Class.forName(className);
		return (Policy) clazz.newInstance();
	}
}
